package Akanksha;

     
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * Clock - class to handle the current time.
 * @author Stephen
 */
public class Clock {
 
//    public static void main (String args[]) {
//        System.out.println(Clock.GetCurrentHour());
//        System.out.println(Clock.GetCurrentMinute());
//        System.out.println(Clock.GetCurrentDateTimeString());
//    }
     
    public static String GetCurrentDateTimeString() {
        DateFormat myDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
        //get current date time with Date()
        Date myDate = new Date();
        return myDateFormat.format(myDate);
    }
    
    public static int GetCurrentHour() {
        Calendar now = Calendar.getInstance();
        return now.get(Calendar.HOUR_OF_DAY);
    }
    
    public static int GetCurrentMinute() {
        Calendar now = Calendar.getInstance();
        return now.get(Calendar.MINUTE);
    }
    
    public static int GetCurrentSecond() {
        Calendar now = Calendar.getInstance();
        return now.get(Calendar.SECOND);
    }
    
}

